//1.引入内置模块 require("模块名称")
const qs = require("querystring");

//2.qs.parse(string)：将查询字符串转换为对象
let str = "userName=web&password=123&count=4";

let obj = qs.parse(str);
console.log(obj);//{userName: 'web',password: '123', count: '4'}


//3.qs.stringify(object) : 将对象转换为查询字符串
console.log(qs.stringify(obj)); //"userName=web&password=123&count=4";